package com.seraph.zys.web.pccexport;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.seraph.bi.suite.support.web.base.BaseResponse;
import com.seraph.bi.suite.support.web.json.JsonProviderController;
import com.seraph.zys.dao.ScOrgDAO;

@Controller
@RequestMapping("/repLockController.do")
public class RepLockController extends JsonProviderController {

	@Autowired
	private ScOrgDAO scOrgDAO;

	public void setScOrgDAO(ScOrgDAO scOrgDAO) {
		this.scOrgDAO = scOrgDAO;
	}

	@Override
	protected Object handleJsonRequest(HttpServletRequest request,
			HttpServletResponse response) {
		String fiscalYear = request.getParameter("fiscalYear");
		String orgCode = request.getParameter("orgCode");
		scOrgDAO.lockReport(fiscalYear, orgCode);
		return new BaseResponse(BaseResponse.TRUE, "锁定成功！");
	}
}
